// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=p1692

//#define COMPILE_P1692
#ifdef COMPILE_P1692

#include <fstream>

using namespace std;

int a, b;

void input() {
	ifstream in("input.txt");
	in >> a >> b;
	in.close();
}

void solve() {

}

void output() {
	ofstream out("output.txt");
	int bb = b;
	for (int i = 0; i < 3; i++) {
		out << a * (bb % 10) << "\n";
		bb /= 10;
	}
	out << a * b << "\n";
	out.close();
}

int main() {
	input();
	solve();
	output();
    return 0;
}


#endif
